package model.xpdl2{
	
	import mx.utils.UIDUtil;
	
	public class WorkflowProcess{
		
		private var _id:String;
		
		private var _name:String;
		
		private var processHeader:ProcessHeader;
		
		private var activities:Activities;
		
		private var transitions:Transitions;
		
		private var associations:Associations;
		
		public function WorkflowProcess()
		{
			id=UIDUtil.createUID();
			name="process_name";
			processHeader=new ProcessHeader();
			activities=new Activities();
			transitions=new Transitions();
			
		}
		
		public function genXML():String{
			
			var xml:String;
			var nspre:String="xpdl2";
			
			xml="<"+nspre+"WorkflowProcess Id=\""+id+"\" Name=\""+name+"\">\n";
			xml+=processHeader.genXML();
			/**
			 * Fix other elements
			 * ***/
			xml+="</"+nspre+"WorkflowProcess>\n";
			
			return xml;
			
		}
		
		public function get id():String{
			return this._id;
		}

		public function set id(id:String):void{
			this._id=id;
		}
		
		public function get name():String{
			return this._name;
		}

		public function set name(name:String):void{
			this._name=name;
		}
		
		public function getProcessHeader():ProcessHeader{
			return this.processHeader;
		}
		
		public function setProcessHeader(processHeader:ProcessHeader):void{
			this.processHeader=processHeader;
		}
		
		public function getActivities():Activities{
			return this.activities;
		}
		
		public function getTransitions():Transitions{
			return this.transitions;
		}
		
	}
}